use thiserror::Error;

#[derive(Error, Debug)]
pub enum WsError {
    #[error("WebSocket error: {0}")]
    WebSocket(#[from] tungstenite::Error),
    
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),
    
    #[error("Connection not found: {0}")]
    ConnectionNotFound(String),
    
    #[error("Invalid message format")]
    InvalidMessageFormat,
    
    #[error("Server is shutting down")]
    ServerShuttingDown,
    
    #[error("Send error: {0}")]
    SendError(String),
}

pub type Result<T> = std::result::Result<T, WsError>;
